****** Figure_11_1: Predicted Values from Benchmark Model, 1960-
use data/Demo_book_country_3.dta, clear
************ democracy variables

* polyarchy, 100-point scale
gen v2x_polyarchy_100 = (v2x_polyarchy / .924) * 100

* polyarchy, missing obs imputed
impute v2x_polyarchy lexical_index inc_chall_combined , gen(v2x_polyarchy_imp)
* 100-point scale
replace v2x_polyarchy_imp = v2x_polyarchy_imp * 100
gen v2x_polyarchy_imp_100 = (v2x_polyarchy_imp / 92.4) * 100
replace v2x_polyarchy_imp_100 = . if sovereign_Cojocaru ==.


qui reg v2x_polyarchy_imp_100 eur_pct_est_smooth predallports53_100km lp_lat_abst i.year if year > 1959, vce(cluster country_id)
qui margins, at(eur_pct_est_smooth = (0(1)100))
marginsplot, ytitle("Polyarchy", size(small)) ylabel(,nogrid) xtitle("Estimated European Percentage", size(small)) title("Predicted Polyarchy Level with 95% CIs", color(black) size(medium)) recast(line) recastci(rarea) ciopts(color(gs8)) plotopts(lc(black)) graphregion(color(white))
graph export "output/Figure_11_1.png", replace
capture graph export "output/Figure_11_1.pdf", replace
capture graph export "output/Figure_11_1.eps", replace
